﻿using Dt261.ViewModel;
using Panuon.UI.Silver;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Dt261.Views
{
    /// <summary>
    /// SettingPage.xaml 的交互逻辑
    /// </summary>
    public partial class SettingPage : Page
    {
        public SettingPage()
        {
            InitializeComponent();
            DataContext = new SettingPageViewModel();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var vm = DataContext as SettingPageViewModel;
#if DEBUG
            if (1==1)
#else
            if(string.IsNullOrEmpty(vm.CorPsw))
            {
                Notice.Show("请输入设备校准密码.", "提示", 3, MessageBoxIcon.Error);
            }
            else if(vm.CorPsw.Equals("DOUTING"))
#endif
            {
                vm.CorPsw = "";
                new PureToneCorrect().ShowDialog();
            }
            else

            {
                Notice.Show("设备校准密码错误.", "提示", 3, MessageBoxIcon.Error);
            }
      
        }
    }
}
